<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

    <script>

        /*function StringConcat(a, b) {
            this.a = a;
            this.b = b;
        }

        StringConcat.prototype = {
            prefix: function(pf) {
                var that = this;
                return function(a, b) {
                    return pf + a + b;
                }
            }

        };

        var sc = new StringConcat();
        var pf = sc.prefix('hello');
        var d = pf('x', 'y');
        console.log(d);*/

        function stringconcat(i1, i2) {
            return i1 + i2;
        }

        stringconcat.prefix = function(msg) {
            return function(m1, m2) {
                return msg + m1 + m2;
            }
        };

        var r1 = stringconcat('a', 'b');
        console.log(r1);

        var r2 = stringconcat.prefix('hello');
        var r3 = r2('a', 'b');
        console.log(r3);

    </script>

</body>
</html>